package structs;

import boardtiles.*;

/**
 * Wrapper class that will hold a set of three Tiles. These will specify
 * the location on the gameboard
 */
public class Vertex {
    public Tile t1, t2, t3;
    boolean developed; // Does it have a building?
    public Vertex(Tile t1, Tile t2, Tile t3) {
        this.t1 = t1;
        this.t2 = t2;
        this.t3 = t3;
    }
    protected boolean addStructure(){
        if (developed){
            return false; // You may not build again.
        }
        //else if(!checkdistance()){
        else if(true){
        // need access to the building list to search it
            // for distance rule above line needs to change *-*
            return false;
        }
        developed = true;
        return true;
    }
    
    public int compare(Vertex other){
        int count = 0;

        if (t1 == other.t1){
            count++;
        }
        if (t2 == other.t2){
            count++;
        }
        if (t3 == other.t3){
            count++;
        }
        if (count == 3){
           return 0; //they are the same vertex
        }
        if (count == 2){
            return 1; //the distance rule applies
        }
        return -1;  // No distance rule.
    }
}
